package downFile;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.http.HttpUtil;

public class HttpFileDown {
	public static void main(String[] args) { 
		//long size = HttpUtil.downloadFile("http://120.27.215.107:9015/list/example/alagis.js", FileUtil.file("F:/face"));
		String line = HttpUtil.downloadString("http://120.27.215.107:9015/list/example/alagis.js",CharsetUtil.charset("UTF-8"));
		
		String lines = HttpUtil.downloadString("http://cpadisc1.cpad.gov.cn/cpad/4.fcfc110bdd2b7e383c72.chunk.js",CharsetUtil.charset("UTF-8"));
		String lin = "";
	 
		while(lines.length() > 0){
			
			if(lines.length() > 120){
				lin = lines.substring(0,120);
				lines = lines.substring(120); 
			}else{
				lin = lines;
				lines = "";
			} 
			System.out.println(lin);
		}
		
	}
}
